What is JDK?
JDK stands for Java Development Kit,a software development environment called JDK is used to create Java programmes and applets.
It consist of JRE + Development
Jdk help in development of java application with help of private JVM, interpreter, compiler and achiver(jar file).
On the same machine, multiple JDK versions can be installed.
Why use JDK
-
JDK includes the tools needed to create Java programs, and JRE runs them.
-
JDk comes with a compiler, a Java app launcher, an Appletviewer, etc.
-
A compiler turns Java source code into bytes.
-
The Java application launcher launches the JRE, loads the required class, and runs the main method.
Features of JDK
-
With its help, you may manage several extensions in a single catch block.
-
Every functionality that JRE has also included in JDK.
-
JDK has programming tools like a compiler and a debugger.
-
Java development and execution environments are made available with JDK.
-
JDk can be installed on Mac, Unix, and Windows operating systems.
-
Compilers:- It is a Java programme that takes developers' text files and converts them into Java class files.
Javac is the main compiler that is used in Java.
-
Debuggers:- Developers can test and debug Java programmes using the debugger Java program.
-
JavaDoc:- Sun Microsystems created JavaDoc as Java documentation. The source programme may be used to generate API documentation in an HTML file using JavaDoc.
What is JVM?
A runtime environment for Java code or applications is provided by the Java Virtual Machine (JVM).
Java bytecode executed in JVM run time environment
Java Runtime Environment(JRE) is componant JVM .
The JVM also run machine code of different programming language that is complied to java bytecode.
JVM are available for different platform, As JDK, JVM and JRE are platform dependent
Why JVM?
-
Java source code can be run on any platform thanks to JVM and java bytecode.
-
It has a tons of frameworks, libraries, and tools.
-
Java programmes can be run on any platform and thus save a lots of time once they are launched.
-
The JVM includes a JIT (Just-in-Time) compiler that turns Java source code into simple machine language.
So that, it operates more quickly as a standard programme.
Features of JVM
-
It makes it possible for us to execute programmes on your own device or on the cloud.
-
The Java Virtual Machine transforms bytes into machine-specific code.
-
Basic Java features like memory management, security, garbage collection, and others are included.
-
The Java Runtime Environment's libraries and files are used by JVM to run the programme.
-
Java Virtual Machine(JVM) include both JDK and JRE.
-
It is also known as an interpreter since it can run Java programmes line by line.
-
At any instance, you may easily provide minimum and maximum RAM to the JVM.
Functions of JVM?
-
Class Loader:-The class loader is a component of JVM that loads class files. The three main tasks it completes are loading, linking, and initialization.
-
Method Area:-The code for Java methods, the constant runtime pool, and class information are all stored in the JVM Method Area.
-
Heap:-Heap Every object, array, and instance variable is kept in a heap. There are several threads that share this memory.
-
Stack Area:-The JVM builds a run-time stack that is kept here for each thread.
A method call's activation record or stack frame is stored in each block of this stack.
The matching frame contains all of
the method's local variables. The JVM will trash a thread's run-time stack when it has finished. It is a private resource.
-
PC Register:-The address of the presently running Java virtual machine instruction is kept in PC registers.
Each thread has its own unique PC register in Java.
-
Native Method Stacks:-The native library's native method stacks are where native code instructions are stored.
Memory is allocated using either native heaps or any kind of stack.
-
Execution Engine:-It is a kind of software that is employed in the testing of software, hardware, and whole systems.
No data about the tested product is ever carried by the test execution engine.
-
Native Method interface:-A programming framework is the Native Method Interface.
It allows libraries and native programmes to call Java code that is executing in a JVM.
-
Native Method Libraries:-The Execution Engine requires a number of Native Libraries (C, C++),
which make up Native Libraries.
What is JRE?
The Java Runtime Environment (JRE) is software needed for Java programmes to function properly.
Many modern online and mobile apps are written in Java so,
the JRE is the underlying technology that allows Java programmes to interface
with operating systems. When you build or develop Java software,
it runs on any operating system without additional change since JRE serves as a translator and facilitator, which offer all the resources.
Why use JRE?
-
Among other supporting files, JRE includes class libraries and the JVM.
JRE doesn't contain development tools like a debugger, compiler, etc.
-
Runtime libraries, util, lang, math, swing, awt, and other significant package classes are used.
-
JRE must be installed on your system if you want to run Java applets.
Features of JRE
-
The Java Runtime Environment is a collection of tools that the JVM depends on to function.
-
Java Web Start and Java Plug-in are two examples of the deployment technology found in JRE.
-
While developers can easily run source code in JRE, they are unable to create and compile Java programs.
-
It contains integration libraries like Java Naming and Directory Interface (JNDI), Java Database Connectivity (JDBC),
Remote Method Invocation (RMI), and others.
-
JRE includes Java HotSpot virtual machine client and JVM.
Comparison Chart
Difference Between JDK, JRE, and JVM are mention below
S.N |
JDK |
JRE |
JVM |
1. |
JDK stands for Java Development Kit. |
JRE stands for Java Runtime Environment |
Jvm stand for JVM is Java Virtual Machine. |
2. |
It is a software development tool that supports the creation of Java applications.
The JDK also comes with a variety of other development tools in addition to JRE. |
It is a type of software bundle that offers Java class libraries along with the JVM.
It also contains additional parts for proper working of Java applications. |
It is an abstract machine that can operate on any platform and has a loader,
execution engine, and runtime data. JVM also known as Java interpreter. |
3. |
JDK depends on the platform. Users must install a different JDK for each OS platform (Linux, Windows, Mac, etc). |
Jre is same as jdk i.e platform dependent |
Users won't need a distinct JVM for each OS platform since JVM, unlike JDK and JRE, is platform-independent. |
4. |
The installer is included with JDK. |
JRE only includes the necessary environments to run source code. |
JDK and JRE both include the JVM. |
5. |
The superset of JRE is JDK. |
JDK's subset is called JRE. |
JVM is a part of JRE. |
The Most Significant Differences Between JDK, JRE, and JVM
-
JRE is a software package that enables Java programmes to run, whereas JDK is a software development kit and JVM is an environment for bytecode execution.
-
JDK, JRE, and JVM are all stands for Java Development Kit, Java Runtime Environment, and Java Virtual Machine, respectively.
-
JRE and JDK are both platform-dependent, however JVM is also not platform-independent.
-
The JDK includes tools for programming, debugging, etc. Software development tools are not included in JVM, although JRE provides class libraries and other supporting files.
-
In contrast to JRE, which simply includes the environment needed to run source code, JDK includes the installer and JVM is included in both JDK and JRE.
Post your comment